home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-08-16 | 2.0 KB | 102 lines | [TEXT/MPS ] |
- c****************************************c
- c
- c ASIN
- c
- c ArcSin returns an angle expressed in radians
- c for any x where -1<= x <= 1
- c
- c
- c Wild Things ASIN
- c © 1989 Language Systems Corporation
- c All Rights reserved
- c
- c****************************************c
- c USAGE:
- c ASIN (theValue)
- c
- c This XFCN uses only standard glue routines.
- c****************************************c
- c use these commands to compile and link:
- c
- !!IFC FALSE
-
- fortran ASIN.f
-
- link -rt XFCN=5002 -w -m ASIN ∂
- -sn Main=ASIN ∂
- -sn f_RunTime=ASIN ∂
- -sn f_Intrinsics=ASIN ∂
- ASIN.f.o ∂
- "{FLibraries}"FORTRANLib.o ∂
- "{FLibraries}"IntrinsicLib.o ∂
- "{Libraries}"Interface.o ∂
- "{Libraries}"Runtime.o ∂
- -o testStack
-
- delete ASIN.f.o
-
- !!ENDC
- c
- c****************************************
- c
- subroutine ASIN(param)
-
- c load the system calls
-
- !!m inlines.f
-
- c include the header file
-
- !!I HyperXCmd.f
-
- c data declarations
- c
- record /XCmdData/ param
- pointer /integer*4/ theHandle
- extended theValue,theAngle
- string theString
-
- c check parameters
-
- if (param.paramCount <> 1) then
- call sysbeep(9)
- theString = 'answer "ASIN requires 1 argument."'
- call SendCardMessage(param,theString)
- return
- end if
-
- c convert arguments
-
- theHandle = param.params(1).ch
- call HLock(%val(theHandle))
- theString = ZeroToPas(param,theHandle^)
- theValue = StrToExt(param,theString)
- call HUnLock(%val(theHandle))
-
- c check to make sure data is valid
-
- If ((theValue < -1.0) .OR. (theValue > 1.0)) then
- theString = 'answer "Argument for ASIN must be -1 <= x <= 1."'
- call SendCardMessage(Param,theString)
- return
- end if
-
- c process arguments
- c note: use the type-specific call (QASIN) because
- c the generic call (ASIN) is the same as this subroutine.
-
- theAngle = QASIN(theValue)
-
- c prepare to return
-
- theString = ExtToStr(param,theAngle)
- param.returnValue.ch = PasToZero(param,theString)
- return
- end
-
- c include the glue routines
-
- !!I XCmdGlue.f
- c
- c****************************************c
-